<?php

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/
//
Route::namespace('Home')->prefix('home')->group(function () {
    Route::post('authorization/login', 'AuthorizationController@login');
    //获取banner
    Route::get('banner','BannerController');
    //用户相关
    Route::resource('user', 'UserController')->except(['show']);
    //发送验证码
    Route::post('send-code', 'UserController@sendSms');
    //获取分类
    Route::resource('category', 'CategoryController');
    //楼层
    Route::get('floor', 'FloorController@index');
    //商品搜索
    Route::get('search', 'ProductController@search');
    //商品
    Route::resource('product', 'ProductController');
    //用户登入后能访问的路由
    Route::middleware(['auth:sanctum'])->group(function () {
        //地址管理
        Route::resource('address','AddressController');
    });
});

//获取配置信息
Route::get('config','ConfigController');
